<template>
  <div>
    <van-nav-bar title="被采纳建议" left-arrow @click-left="$router.push('/my')" />
    <div class="wrap">
      <div v-for="(item,index) in Datalist" :key="index">
        <div class="shang" style="display: flex;align-items: center;">
          <div class="left" style="width: 40vw;padding: 10px;">
            <img style="width: 50px;height: 50px;border-radius: 50%;" src="https://img2.baidu.com/it/u=15116034,3599655768&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=889" alt="" />
            <p>{{ item.releaseUserNickName }}</p>
          </div>
          <div class="right">
            <b>{{ item.title }}</b>
            <p>主要病症：{{ item.disease }}</p>
            <p>采纳时间：{{ new Date(item.adoptTime).toISOString().split("T")[0]}}</p>
          </div>
        </div>
        <div class="xia">
          <hr>
          <h3>我的建议</h3>
          <p>{{ item.content }}</p>
        </div>
      </div>
    </div>
    
  </div>
</template>
<script setup lang="ts">
import { useRouter } from 'vue-router'
import { findMyAdoptedCommentList } from '../../api/wallet'
import { ref } from 'vue'
const router = useRouter()
const Datalist:any = ref([])
const doctorId = ref(parseInt(localStorage.getItem('doctorId') as string))
const sessionId = ref(JSON.parse(localStorage.getItem('sessionId') as string))
const findMyAdoptedCommentList1 = async () => {
  const res = await findMyAdoptedCommentList(doctorId.value, sessionId.value, {
    page: 1,
    count: 5
  })
  console.log(res)
  if (res.data.status == '0000') {
    Datalist.value = res.data.result
  }
}
findMyAdoptedCommentList1()
</script>
<style lang="scss">
.right{
  p{
    line-height: 30px;
  }
}
</style>